//
//  SHLiveEntViewController.m
//  Netease
//
//  Created by 王方伟 on 2017/8/21.
//  Copyright © 2017年 wfw. All rights reserved.
//

#import "SHLiveEntViewController.h"
#import "NTESLiveroomSelectViewController.h"
#import "SHLiveTypeSelectViewController.h"
#import "NTESLiveManager.h"

@interface SHLiveEntViewController ()
@property (nonatomic,strong) IBOutlet UIButton *roleAchorButton;
@property (nonatomic,strong) IBOutlet UIButton *roleAudienceButton;
@end

@implementation SHLiveEntViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupView];
    
}

- (void)setupView{
    [self setupRoleView];
    
}

#pragma mark 设置角色按钮
- (void)setupRoleView{
    UIImage *backgroundImageNormal = [[UIImage imageNamed:@"login_btn_done_normal"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10) resizingMode:UIImageResizingModeStretch];
    UIImage *backgroundImageHighlighted = [[UIImage imageNamed:@"login_btn_done_pressed"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10) resizingMode:UIImageResizingModeStretch];
    
    [self.roleAchorButton setBackgroundImage:backgroundImageNormal forState:UIControlStateNormal];
    [self.roleAchorButton setBackgroundImage:backgroundImageHighlighted forState:UIControlStateHighlighted];
    [self.roleAudienceButton setBackgroundImage:backgroundImageNormal forState:UIControlStateNormal];
    [self.roleAudienceButton setBackgroundImage:backgroundImageHighlighted forState:UIControlStateHighlighted];
}

#pragma mark 主播
- (IBAction)onClickAchorButton:(UIButton *)sender {
    [NTESLiveManager sharedLiveManager].role = NTESLiveRoleAnchor;
    SHLiveTypeSelectViewController *typeSelectVC = [[SHLiveTypeSelectViewController alloc] init];
    [DCURLRouter pushViewController:typeSelectVC animated:YES];
    
}

#pragma mark 观众
- (IBAction)onClickAudienceButton:(UIButton *)sender {
    [NTESLiveManager sharedLiveManager].role = NTESLiveRoleAudience;
    NTESLiveroomSelectViewController *roomSelectVC = [[NTESLiveroomSelectViewController alloc] init];
    [DCURLRouter pushViewController:roomSelectVC animated:YES];
}

@end
